<template>
  <div class="app-container" style="text-align: center">
    <el-table
      v-loading="listLoading"
      :data="list"
      element-loading-text="Loading"
      border
      fit
      highlight-current-row
    >
      <el-table-column align="center" label="申请人" width="95">
        <template slot-scope="scope">
          {{ scope.row.studentId }}
        </template>
      </el-table-column>
      <el-table-column align="center" label="申报奖项">
        <template slot-scope="scope">
          {{ scope.row.awardName }}
        </template>
      </el-table-column>
      <el-table-column align="center" label="审批单位">
        <template slot-scope="scope">
          <span>{{ scope.row.organizationId }}</span>
        </template>
      </el-table-column>
      <el-table-column class-name="status-col" label="操作" width="200" align="center">
        <template slot-scope="scope">
          <el-button type="success" @click="checkDetail(scope.row.id)">
            审批
          </el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
  import {CLASSID_KEY, ROLE_KEY} from "../../constants";
  import {addOneNotice, getNoticeListByClassid} from "../../api";
  import {formatTime} from "../../utils/timeFormat";
  import {teacherQueryApplication} from "../../api/admin";


  export default {
    name: 'ApplyList',
    data() {
      return {
        addInput: '',
        list: null,
        listLoading: true,
        role: localStorage.getItem(ROLE_KEY)
      }
    },
    methods: {
      formatTime: formatTime,
      checkDetail(id) {
        this.$router.push({ path: '/application/check/' + id })
      },
    },
    mounted() {
      this.listLoading = true
      teacherQueryApplication().then(res => {
        // this.list = res.data;
        this.list = [
          {
            id: '1',
            studentId: '2011387',
            status: '0',
            organizationId: '10001',
            awardId:'10001',
            awardName: '校一等奖学金'
          }
        ]
        this.listLoading = false
        console.log(res.data)
      })
    }
  }
</script>
